package com.project_doctor.controller;

import com.project_doctor.pojo.Package;
import com.project_doctor.service.PackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/package")
public class PackageController {
        @Autowired
        PackageService packageService;
    @GetMapping("/getAllPackage")
    public ResponseEntity<?> getAllPackage(){
        List<Package> packages = packageService.list();
        return ResponseEntity.ok(packages);
    }
}
